package com.richinfo.trace2.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
* Created by WangXJ
* 2018-11-30 14:52
*/
@RestController
public class TraceController {
	
	private static Logger logger = LoggerFactory.getLogger(TraceController.class);
	
	@GetMapping(value = "/trace-2")
	public String trace(HttpServletRequest request) {
		logger.info("====== call trace-2 , TraceId:{} , SpanId:{} ======",
				    request.getHeader("X-B3-TraceId"),request.getHeader("X-B3-SpanId"));
		
		return "Trace";
	}
}
